package Test;

//泛型方法
public class Alg2 {
    public <T extends Comparable<T>> T alg2(T[] array){
        T max = array[0];
        for (int i = 1; i < array.length; i++) {
            if (array[i].compareTo(max) > 0) {
                max = array[i];

            }
        }
        return max;
    }
}
